-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple implementation and tests for #2191 #2220
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Current coverage is 89.36% (diff: 100%)@@ master #2220 diff @@
==========================================
Files 39 39
Lines 1467 1467
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 1311 1311
Misses 156 156
Partials 0 0
|
I probably have to create integration tests or you may want me to make some changes in |
@cpojer could you, please, provide some feedback on this? |
Hello! I will take a look when I have time. I work on Jest in open source mostly on my own time and I haven't had much time recently. |
@cpojer, excuse me for hurrying you, I don't want to do that. |
Should I resolve those new conflicts? |
Hey, I was just finally able to take a look at this. I'm not sure if we want to make ts-jest a default in Jest like this. First, I just refactored this test which was super annoying to work with, so any simplification you can make there is appreciated. Second, ts-jest is not really official but I'd like to figure out a way to make it work well with Jest without hardcoding so much. Do you have any suggestions to implement this better? |
Ok, I have several ideas:
|
We do have a "preset" option – it only sucks if you want to use more than one, like TypeScript together with react-native. How about in addition we add a "presets" option that can take N number of presets? They may conflict, so it may not be a good idea. |
Thanks for pointing to |
setupFiles from presets get merged with the local config, so that should work just fine. |
@Igmat thank you for the PR and for the discussion here. Let's go back to the issue and take what we learned from this to make this a bit better. I do definitely want better ts-jest integration but I don't think this is the right way. I think we should try the preset way: let's expand the feature (see normalize.js) to support ts-jest well so we can make it easier to use. I think it is ok if it isn't automatic as long as it is simple to setup. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
This PR implements #2191 issue from
Jest
repo itself and this one also kulshekhar/ts-jest#13.In simple terms - it allows using
Jest
withTypeScript
project just by adding"ts-jest": "latest"
todevDependencies
.Test plan
All below configs should allow normal usage of
Jest
inTypeScript
project.Something like this one was used previously:
With this PR config should look like this:
Same behavior seems to work for
babel-jest
.P.S.
It probably could also contain implementation for #2203 because it seems to be related, but I'm not sure. Could you please tell, should I implement it in this PR or make another one?